<template>
  <div v-if="data.length">
    <v-chart :forceFit="true" :height="height" :data="data" :scale="scale">
      <v-tooltip />
      <v-axis />
      <v-bar :position="p" />
    </v-chart>
  </div>
</template>

<script>

export default {
  props: {
    data: {
      type: Array,
      required: true
    },position: {
      type: String,
      required: true
    }
  },
  mounted(){
    this.p = this.position;
  },
  methods:{ 
  },
  data() {
    return {
      p:'',
      scale: [{
        dataKey: 'sales',
        tickInterval: 20,
      }],
      height: 400,
    }
  }
};
</script>

